import request from "@/utils/request";

// 店铺列表
export function getShopList(params, page = 1, pageSize = 999) {
  return request({
    url: `/shop/list?pageNo=${page}&pageSize=${pageSize}`,
    method: "post",
    data: params,
  });
}

// 获取店铺详情
export function getShopDetail(id) {
  return request({
    url: `/shop/getDetailById?theId=${id}`,
    method: "post",
  });
}

// 新增或者编辑店铺
export function addOrEditShop(data) {
  return request({
    url: "/shop/saveUpdate",
    method: "post",
    data,
  });
}

// 删除店铺
export function deleteShop(id) {
  return request({
    url: `/shop/deleteByStatus?theId=${id}`,
    method: "post",
  });
}

// 获取所有员工
export function getSysUserList(params, page = 1, pageSize = 10) {
  return request({
    url: `/sysUser/list?pageNo=${page}&pageSize=${pageSize}`,
    method: "post",
    data: params,
  });
}

// 没有门店的员工列表
export function getNoShopSysUserList(params, page = 1, pageSize = 10) {
  return request({
    url: `/sysUser/noShopList?pageNo=${page}&pageSize=${pageSize}`,
    method: "post",
    data: params,
  });
}

// 绑定员工
export function bindShopUser(params) {
  return request({
    url: "/sysUser/binding",
    params,
  });
}

// 解绑员工
export function unbindShopUser(params) {
  return request({
    url: "/sysUser/unbinding",
    params,
  });
}

// 获取店铺关联的鞋架
export function getShelfList(params) {
  return request({
    url: `/shopShoeRack/shopRackList`,
    params,
  });
}

// 未关联门店的鞋架
export function getNoShopShelfList(params) {
  return request({
    url: `/shopShoeRack/noConnectionRackList`,
    params,
  });
}

//  绑定鞋架
export function bindShopShelf(params) {
  return request({
    url: "/shopShoeRack/shopAssociateRack",
    params,
  });
}

// 解绑鞋架
export function unbindShopShelf(params) {
  return request({
    url: "/shopShoeRack/userCancelAssociateShop",
    params,
  });
}

/**
 * 开发者列表
 */
export function getDeveloperList(params, page = 1, pageSize = 10) {
  return request({
    url: `/developer/list?pageNo=${page}&pageSize=${pageSize}`,
    method: "post",
    data: params,
  });
}

/**
 * 区域门店配置列表
 */
export function getAreaShopList(params, page = 1, pageSize = 10) {
  return request({
    url: `/regionWashShop/list?pageNo=${page}&pageSize=${pageSize}`,
    method: "post",
    data: params,
  });
}

/**
 * 获取详情
 */
export function getAreaShopDetail(id) {
  return request({
    url: `/regionWashShop/getDetailById?theId=${id}`,
    method: "post",
  });
}

/**
 * 新增
 */
export function addAreaShop(data) {
  return request({
    url: `/regionWashShop/save`,
    method: "post",
    data,
  });
}

/**
 * 修改
 */
export function editAreaShop(data) {
  return request({
    url: `/regionWashShop/update`,
    method: "post",
    data,
  });
}

/**
 * 删除
 */
export function deleteAreaShop(id) {
  return request({
    url: `/regionWashShop/deleteByStatus?theId=${id}`,
    method: "post",
  });
}



/**
 * 查询绑定的权限数据
 */
export function getBindList(data) {
  return request({
    url: `/shop/getBindList`,
    method: "post",
    data,
  });
}

/**
 * p批量绑定数据权限
 */
export function batchBindUserShop(data) {
  return request({
    url: `/shop/batchBindUserShop`,
    method: "post",
    data,
  });
}

